-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide the option to specify which search engines to use #50
Conversation
In the default configuration, all engines are used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind to merge that pull. The only thing I am not really comfortable with is the eval() you are using. I would probably create just a dictionary and do mapping between the engines and the actual objects.
I will still also discuss this with @aboul3la and see ig that affect the tool from any other perspective.
Thanks a lot for the pull request though :)
@the-storm: I definitely get that. The reason why I considered it acceptable in this case is because the conditionals effectively whitelist what will ever pass through to the |
@Hainish I think that would be very good. So I can merge the PR right away :) |
@the-st0rm: done |
Hello @Hainish, Thanks for your PR. We're glad to support EFF and https-everywhere. I just have some few suggestions to improve this PR before I can merge it.
Below is a little code snippet i wrote on how the code should be: supported_engines = {'baidu':BaiduEnum,
'yahoo':YahooEnum,
'google':GoogleEnum,
'bing':BingEnum,
'ask':AskEnum,
'netcraft':NetcraftEnum,
'dnsdumpster':DNSdumpster,
'virstotal':Virustotal,
'threatcrowd':ThreatCrowd,
'ssl':CrtSearch,
'passivedns':PassiveDNS
}
chosenEnums = []
if engines == None:
chosenEnums = [BaiduEnum, YahooEnum, GoogleEnum, BingEnum, AskEnum,
NetcraftEnum, DNSdumpster, Virustotal, ThreatCrowd, CrtSearch, PassiveDNS]
else:
engines = engines.split(',')
for engine in engines:
if supported_engines.has_key(engine.lower()):
chosenEnums.append(supported_engines[engine.lower()]) Kindly update the PR so I can merge it. |
@aboul3la: Thanks for the words of support! I've updated this PR. |
Thank you @Hainish. It's merged now |
else: | ||
engines = engines.split(',') | ||
for engine in engines: | ||
if supported_engines.has_key(engine.lower()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aboul3la This breaks Python3 compatibility because 'has_key' function was removed in Python 3.
This is useful for https://github.com/EFForg/https-everywhere, see issue EFForg/https-everywhere#7277 (comment)
With this, we can specify what search engines to use - best configuration in our case is